package org.budo.phone.freeswitch.util;

/**
 * @author lmw
 */
public class UserXmlUtil {
    public static String userXml(String domain, String user, String password) {
        return "<document type=\"freeswitch/xml\"> \r\n" + //
                "  <section name=\"directory\"> \r\n" + //
                "    <domain name=\"" + domain + "\"> \r\n" + //
                "      <params> \r\n" + //
                "        <param name=\"dial-string\" value=\"{presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}\"/> \r\n" + //
                "      </params>  \r\n" + //
                "      <groups> \r\n" + //
                "        <group name=\"default\"> \r\n" + //
                "          <users> \r\n" + //
                "            <user id=\"" + user + "\"> \r\n" + //
                "              <params> \r\n" + //
                "                <param name=\"password\" value=\"" + password + "\"/>  \r\n" + //
                "              </params>  \r\n" + //
                "              <variables>\r\n" + //
                "                <variable name=\"toll_allow\" value=\"domestic,international,local\"/>\r\n" + //
                "                <variable name=\"accountcode\" value=\"" + user + "\"/>\r\n" + //
                "                <variable name=\"user_context\" value=\"default\"/>\r\n" + //
                "                <variable name=\"effective_caller_id_name\" value=\"Extension " + user + "\"/>\r\n" + //
                "                <variable name=\"effective_caller_id_number\" value=\"" + user + "\"/>\r\n" + //
                "                <variable name=\"outbound_caller_id_name\" value=\"$${outbound_caller_name}\"/>\r\n" + //
                "                <variable name=\"outbound_caller_id_number\" value=\"$${outbound_caller_id}\"/>\r\n" + //
                "                <variable name=\"callgroup\" value=\"techsupport\"/>\r\n" + //
                "                <variable name=\"sip-force-contact\" value=\"NDLB-connectile-dysfunction\"/>" + //
                "              </variables>" + //
                "            </user> \r\n" + //
                "          </users> \r\n" + //
                "        </group> \r\n" + //
                "      </groups> \r\n" + //
                "    </domain> \r\n" + //
                "  </section> \r\n" + //
                "</document>";
    }
}
